package serverMessage;
import time.LogicalTimeStamp;


public class RegisterMEResponse extends ServerMessage{
	private static final long serialVersionUID = 7613014737570757165L;

	private boolean response;  // true means registration approved
							   // false means cannot register
	
	private LogicalTimeStamp requestTime; // this MEResponse corresponds to MERequest with messageTS=requestTime
	
	public RegisterMEResponse(boolean response, LogicalTimeStamp reqTime, LogicalTimeStamp msgTS) {
		super(RegisterMEResponse.REGISTER_ME_RESPONSE, msgTS);
		this.response = response;
		this.requestTime = reqTime;
	}

	// did the sender responded OK or notOK
	public boolean getResponse(){
		return response;
	}
	
	public LogicalTimeStamp getReqTime(){
		return requestTime;
	}
	
	public LogicalTimeStamp getMessageTS(){
		return super.getMessageTS();
	}
	
	public String toString(){
		return "RegisterMEResponse, " + " request time=" + this.requestTime + " reponse=" + this.response;
	}
}
